/**
 * 
 */
package neptune.web.client.model;

import java.util.ArrayList;

import neptune.web.client.model.topology.SerializableIPAddress;
import neptune.web.client.model.topology.SerializableTopology;

import com.google.gwt.user.client.rpc.IsSerializable;

/**
 * @author Roberto Bifulco [info@robertobifulco.it, robertobifulco.it]
 * 
 */
public class SerializableExperiment implements IsSerializable {

	/**
	 * Amministratore (creatore) dell'esperimento
	 */
	private String administrator;
	/**
	 * Utenti con permessi di "lettura"
	 * 
	 */
	private ArrayList<String> users = new ArrayList<String>(0);
	/**
	 * Gli utenti "privilegiati" di questo esperimento
	 * 
	 */
	private ArrayList<String> privilegedUsers = new ArrayList<String>(0);
	/**
	 * La topologia associata all'esperimento
	 */
	private SerializableTopology topology;
	/**
	 * Identificativo (nome) univoco dell'esperimento
	 */
	private String experimentId;
	/**
	 * Oggetto che rappresenta l'attuale stato dell'esperimento
	 */
	private SerializableExperimentState state;
	/**
	 * La subnet associata all'esperimento
	 */
	private SerializableIPAddress assignedSubnet;

	/**
	 * @return the administrator
	 */
	public String getAdministrator() {
		return administrator;
	}

	/**
	 * @param administrator
	 *            the administrator to set
	 */
	public void setAdministrator(String administrator) {
		this.administrator = administrator;
	}

	/**
	 * @return the users
	 */
	public ArrayList<String> getUsers() {
		return users;
	}

	/**
	 * @param users
	 *            the users to set
	 */
	public void setUsers(ArrayList<String> users) {
		this.users = users;
	}

	/**
	 * @return the privilegedUsers
	 */
	public ArrayList<String> getPrivilegedUsers() {
		return privilegedUsers;
	}

	/**
	 * @param privilegedUsers
	 *            the privilegedUsers to set
	 */
	public void setPrivilegedUsers(ArrayList<String> privilegedUsers) {
		this.privilegedUsers = privilegedUsers;
	}

	/**
	 * @return the topology
	 */
	public SerializableTopology getTopology() {
		return topology;
	}

	/**
	 * @param topology
	 *            the topology to set
	 */
	public void setTopology(SerializableTopology topology) {
		this.topology = topology;
	}

	/**
	 * @return the experimentId
	 */
	public String getExperimentId() {
		return experimentId;
	}

	/**
	 * @param experimentId
	 *            the experimentId to set
	 */
	public void setExperimentId(String experimentId) {
		this.experimentId = experimentId;
	}

	/**
	 * @return the state
	 */
	public SerializableExperimentState getState() {
		return state;
	}

	/**
	 * @param state
	 *            the state to set
	 */
	public void setState(SerializableExperimentState state) {
		this.state = state;
	}

	public void addUser(String username) {
		this.users.add(username);
	}

	public void removeUser(String username) {
		this.users.remove(username);
	}

	public void addPrivilegedUser(String username) {
		this.privilegedUsers.add(username);
	}

	public void removePrivilegedUser(String username) {
		this.privilegedUsers.remove(username);
	}

	/**
	 * @param assignedSubnet
	 *            the assignedSubnet to set
	 */
	public void setAssignedSubnet(SerializableIPAddress assignedSubnet) {
		this.assignedSubnet = assignedSubnet;
	}

	/**
	 * @return the assignedSubnet
	 */
	public SerializableIPAddress getAssignedSubnet() {
		return assignedSubnet;
	}
}
